#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/1/25 16:03
# @Author  : yuxi
# @Site    : 
# @File    : runtest.py
# @Software: PyCharm
import sys
import unittest
from utils.HTMLTestRunner import HTMLTestRunner
import time
import unittest
suite = unittest.TestSuite()#定义测试集合
all_case = unittest.defaultTestLoader.discover(r'E:\WorkSpace\dgt_UIAutoTest\src\case','dgt_*.py')
for case in all_case:
    #循环添加case到测试集合里面
    suite.addTests(case)
now = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time()))
filename = "E:/WorkSpace/dgt_UIAutoTest/report/" + now + "test.html"
print(filename)
fp = open(filename, "wb")
runner = HTMLTestRunner(stream=fp, title=u"店管通UI自动化测试", description=u"用例执行情况")
runner.run(suite)
fp.close()